tone_synth object
This method moves the cursor to any position in milliseconds.
bool seek_ms(double new_position)
Parameters:
new_position
The position to seek to, in milliseconds.
Return value:
true on success, false on failure.
Remarks:
Whereas the rest and rewind methods seek relative to your current position, this seeks to an actual position of the piece. Therefore if you specify the position as 1.5, the cursor will move to position 1.5 as opposed to 1.5 beats previous or after the current position.
Example:
// Write a chord, two melody notes, then rewind to add some more.
tone_synth synth;
void main()
{
synth.waveform_type=2;
synth.note_ms("C4", 2000);
synth.note_ms("E4", 2000);
synth.note_ms("G4", 2000);
synth.waveform_type=3;
synth.note_ms("C5", 1000);
synth.rest_ms(1000);
synth.note_ms("C6", 1000);
synth.seek_ms(333);
synth.note_ms("E5", 333);
synth.rest_ms(333);
synth.note_ms("G5", 333);
synth.rest_ms(333);
synth.write_wave_file("synth.wav");
}